package com.servlet.response; /**
 * @author wzm
 * @create 2023-06-25 9:10
 */

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/rs02")
public class ResponseServlet02 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       //调用dopost
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      //尝试是否能获取数据
        System.out.println(request.getAttribute("data"));
        System.out.println("我是通过rs01请求重定向过来的资源rs02");
    }
}
